package com.cswnode.demo.entity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

/**
 * 用户表(User)实体类
 *
 * @author makejava
 * @since 2021-01-26 11:10:20
 */
public class User implements Serializable, UserDetails {
    private static final long serialVersionUID = 750561118877020248L;
    /**
    * 用户id
    */
    private Long userId;
    /**
    * 用户名
    */
    private String username;
    /**
    * 用户中文名
    */
    private String userNameCn;
    /**
    * 用户密码
    */
    private String password;
    /**
    * 用户类别
    */
    private String type;

    /**
    * 是否激活
    */
    private String isActive;
    /**
    * 邮箱
    */
    private String email;
    /**
    * 性别
    */
    private String sex;
    /**
    * 联系电话
    */
    private String phone;
    /**
    * 创建时间
    */
    private Date createTime;
    /**
    * 是否删除
    */
    private String isDelete;

    /**
     * 激活码
     */
    private String code;

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", userNameCn='" + userNameCn + '\'' +
                ", password='" + password + '\'' +
                ", type='" + type + '\'' +
                ", isActive='" + isActive + '\'' +
                ", email='" + email + '\'' +
                ", sex='" + sex + '\'' +
                ", phone='" + phone + '\'' +
                ", createTime=" + createTime +
                ", isDelete='" + isDelete + '\'' +
                ", code='" + code + '\'' +
                '}';
    }


    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserNameCn() {
        return userNameCn;
    }

    public void setUserNameCn(String userNameCn) {
        this.userNameCn = userNameCn;
    }



    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIsActive() {
        return isActive;
    }

    public void setIsActive(String isActive) {
        this.isActive = isActive;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}